package agb.Conexion;



public class IngresoTeclado
{
    public static boolean numeros(String num)
    {
        char car;
        if(num.length()==0)
        {
            return false;
        }
        else
        {
            for(int i=0;i<num.length();i++)
            {
                car = num.charAt(i);
                if(car<=47 || car>=58)
                {
                    return false;
                }
            }
            return true;
        }
    }

    public static boolean letras(String let)
    {
        char car;
        if(let.length()==0)
        {
            return false;
        }
        else
        {
            for (int i=0;i<let.length();i++)
            {
                car= let.charAt(i);
                if( (car<=64 || car>90) &&(car<=96 || car>=123))
                {
                    return false;
                }
            }
            return true;
        }

    }

    public static boolean letrasEspacio(String let)
    {
        char car;
        if(let.length()==0)
        {
            return false;
        }
        else
        {
            for (int i=0;i<let.length();i++)
            {
                car= let.charAt(i);
                if( (car<=64 || car>90) &&(car<=96 || car>=123) && (car!=32) )
                {
                    return false;
                }
            }
            return true;
        }

    }

        public static boolean AlfaNumerico(String let)
    {
        char car;
        if(let.length()==0)
        {
            return false;
        }
        else
        {
            for (int i=0;i<let.length();i++)
            {
                car= let.charAt(i);
                if( (car<=64 || car>90) &&(car<=96 || car>=123) && (car!=32)&& (car<=47 || car>=58))
                {
                    return false;
                }
            }
            return true;
        }

    }

        public static boolean DNI(String dni){
            if(dni.length()!=8){
                return false;
            }else{
                return true;
            }
        }

        public static boolean RUC(String ruc){
            if(ruc.length()!=11){
                return false;
            }else{
                return true;
            }
        }

        public static boolean Telefono(String telefono){
            if(telefono.length()<=5 || telefono.length()>=10 ){
                return false;
            }else{
                return true;
            }
        }
}


